package com.eva.learn.concurrent.thinkInJava.communication;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 一旦异常逃出任务run()方法，它就会向外传播到控制台，除非才去特殊步骤捕获这种错误的异常
 * 
 * @author Evain.C
 *
 */
public class ExceptionThread implements Runnable {

	@Override
	public void run() {
		throw new RuntimeException();
	}

	public static void main(String[] args) {
		try {
			ExecutorService exec = Executors.newCachedThreadPool();
			exec.execute(new ExceptionThread());
		} catch (Exception e) {
			System.out.println("Execption has been handled!");
		}
	}

}
